class Area_Tools:
    """
    区域工具类
    """

    area_objs = [
        {
            "No": 510500,
            "name": "泸州市",
            "cityRange": []  # 城镇范围
        },
        {
            "No": 510502,
            "name": "江阳区",
            "cityRange": [1, 11]  # 城镇范围
        },
        {
            "No": 510503,
            "name": "纳溪区",
            "cityRange": [1, 8]  # 城镇范围
        },
        {
            "No": 510504,
            "name": "龙马潭区",
            "cityRange": [1, 11]  # 城镇范围
        },
        {
            "No": 510521,
            "name": "泸县",
            "cityRange": [1, 8]  # 城镇范围
        },
        {
            "No": 510522,
            "name": "合江县",
            "cityRange": [1, 8]  # 城镇范围
        },
        {
            "No": 510524,
            "name": "叙永县",
            "cityRange": [1, 7]  # 城镇范围
        },
        {
            "No": 510525,
            "name": "古蔺县",
            "cityRange": [1, 7]  # 城镇范围
        },

    ]

    @staticmethod
    def get_area_name(area_code) ->str:
        """
        通过区域ID，获取对应的区域名称
        :param area_code: 区域代码
        :return: 区域名称
        """
        for area_obj in Area_Tools.area_objs:
            if area_obj['No'] == area_code:
                return area_obj['name']


